
def discriminant(a, b, c):
    return b * b - 4 * a * c

import math

def quadratic_roots(a, b, c):
    if a == 0 and b == 0: return None
    if a == 0: return [ - c / b ]
    discr = discriminant(a, b, c)
    if discr < 0: return []
    denom = 2 * a
    if discr == 0: return [ - b / denom ]
    droot = math.sqrt(discr)
    return [ (- b + droot) / denom,
             (- b - droot) / denom ]

